<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8"/>
    <title>java</title>
    <link rel="stylesheet" th:href="@{/css/myStyle.css}"/>
</head>
<body>
<div class="n-head">
    <div class="g-doc f-cb">
        <div class="user">
            请<a href="/login">[登录]</a>
        </div>
        <ul class="nav">
            <li><a href="/">首页</a></li>
        </ul>
    </div>
</div>
<div class="g-doc">
    <div class="m-tab m-tab-fw m-tab-simple f-cb">
        <div class="tab">
            <ul>
                <li class="z-sel" ><a href="/">所有内容</a></li>
            </ul>
        </div>
    </div>
    <div class="n-plist">
        <ul class="f-cb" id="plist">
            <script>
                (function f() {
                    var hidediv = document.createElement("div");
                    hidediv.innerHTML = "[[${commodity}]]";
                    var data = hidediv.innerText;
                    var jsondata = JSON.parse(data);
                    var arr = jsondata.array;

                    const ul = window.document.getElementById("plist");
                    let str = "";
                    for(const i in arr){
                        str += "<li>" +
                            "<a href=\"/show?id=" + arr[i].id + "\" class=\"link\">" +
                            "<div class=\"img\"><img src=\"" + arr[i].picUrl + "\" onerror=\"javascript:this.src = '/image/NoPic.png';\" alt=\"" + arr[i].summary + "\"></div>" +
                            "<h3>" + arr[i].title + "</h3>" +
                            "<div class=\"price\">" +
                            "<span class=\"v-unit\">¥</span>" +
                            "<span class=\"v-value\">" + arr[i].price + "</span>" +
                            "</div>" +
                            "</a>" +
                            "</li>";
                    }
                    ul.innerHTML = str;
                })()
            </script>
        </ul>
    </div>
</div>
<div class="n-foot">
    <p>
        杭研有数：陈佳——在校作业
    </p>
</div>
</body>
</html>